package com.itheima.web;

import com.itheima.pojo.User;
import com.itheima.result.R;
import com.itheima.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 * @Author: 斌
 * @DateTime: 2023年02月10日  16:35:47
 * @Description: com.itheima.web
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping("/sendMsg")
    public R sendMsg(@RequestBody User user, HttpSession session){
        return userService.sendMsg(user,session);
    }
    @PostMapping("/login")
    public R login(@RequestBody User user, HttpSession session){
        return userService.login(user,session);
    }
    @PostMapping("/loginout")
    public R loginOut( HttpSession session){
        return userService.loginOut(session);
    }


}
